﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using System.Collections;

namespace CRM.Cache
{
    [ServiceContract]
    public interface ICache
    {
        [OperationContract]
        bool ContainKey(string argKey);

        [OperationContract]
        bool Add(string argKey, object argValue);

        [OperationContract(Name = "Add_Time")]
        bool Add(string argKey, object argValue, DateTime argDateExpiration);

        [OperationContract]
        bool Set(string argKey, object argValue);

        [OperationContract(Name = "Set_Time")]
        bool Set(string argKey, object argValue, DateTime argDateExpiration);

        [OperationContract]
        object Get(string argKey);

        [OperationContract]
        bool Remove(string argKey);

        //memcache专用
        [OperationContract(Name = "Remove_Time")]
        bool Remove(string argKey, DateTime argDateExpiration);

        //memcache专用
        [OperationContract(Name = "Remove_All")]
        bool Remove();

        //memcache专用
        [OperationContract(Name = "Remove_Server")]
        bool Remove(ArrayList servers);
    }
}
